Support Env-based SDP part 2: Add resolve method to SynthesizerRef struct in API#561
Support Env-based SDP part 2: Add resolve method to SynthesizerRef struct in API#561ninjadq wants to merge 2 commits intoAzure:mainfrom
Conversation
…dd corresponding tests
8b67064 to
ee8f74f
Compare
…nd update corresponding tests
| case 0: | ||
| return nil, ErrNoMatchingSelector | ||
| case 1: | ||
| return &synthList.Items[0], nil |
There was a problem hiding this comment.
If we always select 1 synthesizer, why don't we just use the name matching?
There was a problem hiding this comment.
Based on my understanding, even if the composition controller finds multiple matching synthesizers, it cannot use all of them to synthesize the resource. The improved label matching here is intended to give external users more flexibility, allowing them to specify the synthesizer with a dynamic label rather than a static name.
There was a problem hiding this comment.
As Fuming commented, the composition can only consume one synthesizer at the moment.
In addition, the label can include more semmantic meanings which make it more expressive when there are a lot of simmilar synthesizers exist.
For example, suppose a scenario: a service has multiple versions exist and user want to switch between those versions for some reason like upgrade, testing, rollback, etc.
And the symthesizer's names be like sym-1, sym-2, sym-3, ... just use name in composition is ambiguise and error prone.
Instead using label selector like
service=svc-1,
version=v1.0.0
is more intuitive
Add resolve method for SynthesizerRef